QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

## 设置版本号
VERSION = 1.2.1.0
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0


# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

## 运行win的bat脚本
defineReplace(win32Path) {#定义替换

    win32:1 ~= s|/|\\\\|g
    contains(1, ^\\.*):pfx = \\
    else:pfx =
    segs = $$split(1, \\)#
    out =
    for(seg, segs) {
        equals(seg, ..):out = $$member(out, 0)
        else:!equals(seg, .):out += $$seg
    }
    return($$join(out, \\, $$pfx))
}

win32 {
    bat.commands  = $$win32Path("$$PWD/qt_bat/qt_qmake_pre.bat") release $$win32Path("$$PWD/../")#run before make
    first.depends = $(first) bat
    export(first.depends)
    export(bat.commands)
    QMAKE_EXTRA_TARGETS += first bat #other goal
#    CONFIG( debug, debug|release) {
#        QMAKE_POST_LINK += $$win32Path("$$PWD/qt_bat/qt_qmake_post.bat") release $$win32Path("$$PWD/../../")#
#    } else {
#        QMAKE_POST_LINK += $$win32Path("$$PWD/qt_bat/qt_qmake_post.bat") release $$win32Path("$$PWD/../../")#
#    }

}

unix:!macx {
## 需要修改文件才能触发，后续需要替换，测试可以先用，后面再找替代方案
     system(chmod +x $$PWD/qt_bat/qt_qmake_pre.sh)  # 确保脚本有执行权限
#    system($$PWD/qt_bat/qt_qmake_pre.sh)

    bat.commands  = "$$PWD/qt_bat/qt_qmake_pre.sh" release "$$PWD/../"#run before make
    first.depends = $(first) bat
    export(first.depends)
    export(bat.commands)
    QMAKE_EXTRA_TARGETS += first bat #other goal

}


SOURCES += \
    main.cpp \
    mainwindow.cpp \
    src/node_editor_subs/device_mdle/device_file_browser.cpp \
    src/node_editor_subs/device_mdle/device_file_cache.cpp \
    src/node_editor_subs/device_mdle/device_mdle.cpp \
    src/node_editor_subs/device_mdle/device_select.cpp \
    src/node_editor_subs/interface_mdle/fil_blck/interface_fil_master.cpp \
    src/node_editor_subs/interface_mdle/fil_blck/interface_fil_slaver.cpp \
    src/node_editor_subs/interface_mdle/interface_fil.cpp \
    src/node_editor_subs/interface_mdle/interface_mdle.cpp \
    src/node_editor_subs/line_mdle/line_mdle.cpp \
    src/node_editor_subs/node_editor_subs.cpp \
    src/public_frame_subs/dirs_mdle/browser_blck/QFrameDirsBrowser.cpp \
    src/public_frame_subs/dirs_mdle/tree_blck/qframedirstree.cpp \
    src/public_frame_subs/editor_mdle/simple_blck/qframeeditorsimple.cpp \
    src/public_frame_subs/main_mdle/shortcut_blck/qframemainshortcut.cpp \
    src/public_opt_subs/combobox_mdle/search_blck/QComboBoxSearch.cpp \
    src/public_opt_subs/table_mdle/operate_blck/QTableWidgetOperate.cpp \
    src/public_opt_subs/language_mdle/markdown_blck/markdownhighlighter.cpp \
    src/public_opt_subs/treeview_mdle/markdown_title_blck/QTreeViewMdTitle.cpp \
    src/public_opt_subs/typedef_mdle/check_blck/QTypedefCheckHex.cpp \
    src/software_update_subs/help_document_mdle/help_document_mdle.cpp \
    src/software_update_subs/software_update_subs.cpp \
    src/software_update_subs/version_blck/version_blck.cpp \
    src/team_manager_subs/flowchart_blck/flowchart_blck.cpp \
    src/team_manager_subs/team_manager_subs.cpp \
    src/team_manager_subs/team_mdle/team_mdle.cpp \
    src/team_manager_subs/timechart_blck/timechart_blck.cpp

HEADERS += \
    mainwindow.h \
    src/MACRO.h \
    src/node_editor_subs/device_mdle/device_file_browser.h \
    src/node_editor_subs/device_mdle/device_file_cache.h \
    src/node_editor_subs/device_mdle/device_mdle.h \
    src/node_editor_subs/device_mdle/device_select.h \
    src/node_editor_subs/interface_mdle/fil_blck/interface_fil_master.h \
    src/node_editor_subs/interface_mdle/fil_blck/interface_fil_slaver.h \
    src/node_editor_subs/interface_mdle/interface_fil.h \
    src/node_editor_subs/interface_mdle/interface_mdle.h \
    src/node_editor_subs/line_mdle/line_mdle.h \
    src/node_editor_subs/node_editor_subs.h \
    src/public_frame_subs/dirs_mdle/browser_blck/QFrameDirsBrowser.h \
    src/public_frame_subs/dirs_mdle/tree_blck/qframedirstree.h \
    src/public_frame_subs/editor_mdle/simple_blck/qframeeditorsimple.h \
    src/public_frame_subs/main_mdle/shortcut_blck/qframemainshortcut.h \
    src/public_opt_subs/combobox_mdle/search_blck/QComboBoxSearch.h \
    src/public_opt_subs/mouse_mdle/right_click_blck/PageMenuFilter.h \
    src/public_opt_subs/mouse_mdle/right_click_blck/TableMenuFilter.h \
    src/public_opt_subs/table_mdle/funciton_blck/QTableWidgetSave.h \
    src/public_opt_subs/table_mdle/operate_blck/QTableWidgetOperate.h \
    src/public_opt_subs/language_mdle/markdown_blck/markdownhighlighter.h \
    src/public_opt_subs/treeview_mdle/markdown_title_blck/QTreeViewMdTitle.h \
    src/public_opt_subs/typedef_mdle/check_blck/QTypedefCheckHex.h \
    src/public_opt_subs/windows_mdle/ubuntu_blck/setLinux.h \
    src/public_opt_subs/windows_mdle/window_blck/setWindows.h \
    src/software_update_subs/help_document_mdle/help_document_mdle.h \
    src/software_update_subs/software_update_subs.h \
    src/software_update_subs/version_blck/version_blck.h \
    src/team_manager_subs/flowchart_blck/flowchart_blck.h \
    src/team_manager_subs/team_manager_subs.h \
    src/team_manager_subs/team_mdle/team_mdle.h \
    src/team_manager_subs/timechart_blck/timechart_blck.h
FORMS += \
    mainwindow.ui \
    src/node_editor_subs/device_mdle/device_file_browser.ui \
    src/node_editor_subs/device_mdle/device_file_cache.ui \
    src/node_editor_subs/device_mdle/device_mdle.ui \
    src/node_editor_subs/device_mdle/device_select.ui \
    src/node_editor_subs/interface_mdle/interface_mdle.ui \
    src/node_editor_subs/line_mdle/line_mdle.ui \
    src/node_editor_subs/node_editor_subs.ui \
    src/public_frame_subs/dirs_mdle/browser_blck/QFrameDirsBrowser.ui \
    src/public_frame_subs/dirs_mdle/tree_blck/qframedirstree.ui \
    src/public_frame_subs/editor_mdle/simple_blck/qframeeditorsimple.ui \
    src/public_frame_subs/main_mdle/shortcut_blck/qframemainshortcut.ui \
    src/public_opt_subs/combobox_mdle/search_blck/QComboBoxSearch.ui \
    src/public_opt_subs/treeview_mdle/markdown_title_blck/QTreeViewMdTitle.ui \
    src/software_update_subs/help_document_mdle/help_document_mdle.ui \
    src/software_update_subs/software_update_subs.ui \
    src/software_update_subs/version_blck/version_blck.ui \
    src/team_manager_subs/flowchart_blck/flowchart_blck.ui \
    src/team_manager_subs/team_manager_subs.ui \
    src/team_manager_subs/team_mdle/team_mdle.ui \
    src/team_manager_subs/timechart_blck/timechart_blck.ui

RESOURCES += \
    public_resource/public_icon.qrc

# 添加图标
RC_ICONS = condensed_light_pavilion.ico
